In [1]:
import plotly.offline as pyo

from plotly.graph_objs import *

import chart_studio.plotly as py

import pandas as pd
from pandas import DataFrame
In [9]:
from plotly import tools
import random
In [10]:
pyo.offline.init_notebook_mode()
In [23]:
plots = tools.make_subplots(cols = 2, rows = 2, print_grid = True)
This is the format of your plot grid:
[ (1,1) x,y   ]  [ (1,2) x2,y2 ]
[ (2,1) x3,y3 ]  [ (2,2) x4,y4 ]

In [24]:
plots.append_trace(trace = {'type' : 'scatter',
                            'mode' : 'markers',
                           'x' : [random.random() for i in range(10)],
                           'y' : [random.random() for i in range(10)],
                           'name' : 'trace1'},
                    row=1, col=1)

pyo.iplot(plots)
In [25]:
plots.append_trace(trace = {'type' : 'scatter',
                            'mode' : 'markers',
                           'x' : [random.random() for i in range(10)],
                           'y' : [random.random() for i in range(10)],
                           'name' : 'trace2'},
                    row=1, col=2)
pyo.iplot(plots)
In [26]:
plots.append_trace(trace = {'type' : 'scatter',
                            'mode' : 'markers',
                           'x' : [random.random() for i in range(10)],
                           'y' : [random.random() for i in range(10)],
                           'name' : 'trace3'},
                    row=2, col=1)

plots.append_trace(trace = {'type' : 'scatter',
                            'mode' : 'markers',
                           'x' : [random.random() for i in range(10)],
                           'y' : [random.random() for i in range(10)],
                           'name' : 'trace4'},
                    row=2, col=2)
pyo.iplot(plots)
In [27]:
plots.append_trace(trace = {'type' : 'scatter',
                            'mode' : 'markers',
                           'x' : [random.random() for i in range(10)],
                           'y' : [random.random() for i in range(10)],
                           'name' : 'trace5'},
                    row=1, col=1)
pyo.iplot(plots)
In [ ]: